{% extends 'base.html' %}
	
{% block content %}
<div class="content">
	<h1>Cadastro</h1>
	<script>
		$("#user_menu").addClass("selected");
	</script>  

	{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}

	<form action="" method="post">
		{% csrf_token %}
		<table>
			<tr>
			<th><label for="nome">Nome: </label></th>
			<td><input type="text" name="first_name" id="user_name" 
				value="{% if form.instance.name %}{{form.instance.name}}{% else %}{{form.data.name}}{% endif %}" /></td>
			</tr>
		<tr>
			<th><label for="email">E-mail: </label></th>
			<td><input type="text" name="email" id="user_email" 
				value="{% if form.instance.email %}{{form.instance.email}}{% else %}{{form.data.email}}{% endif %}" /></td>
		</tr>
		{% if form.non_field_errors %}
				<strong style="color:red;"> {{form.non_field_errors}}</strong>
		{% endif %}
		<tr>
			<th><label for="senha">Senha: </label></th>
			<td><input type="password" name="password" id="user_password" value="{{ user.password }}" /></td>
		</tr>
		<tr>
			<th><label for="senha">Confirmar Senha: </label></th>
			<td><input type="password" name="confirm_password" id="user_password" value="{{ user.password }}" /></td>
		</tr>
		</table>
		<input type="submit" value="Salvar" class="button" />
		
	</form>
	
</div>
{% endblock %}